package lookie.app.ui.laf;

import java.util.Set;

import javax.annotation.PostConstruct;

import org.springframework.beans.factory.annotation.Autowired;

import lookie.swing.laf.LookAndFeelDescriptorContributor;
import lookie.swing.laf.LookAndFeelRegistry;

public class LookAndFeelDescriptorContributorExecutor {

	@Autowired
	private LookAndFeelRegistry lookAndFeelRegistry;

	private Set<LookAndFeelDescriptorContributor> contributors;

	public void setContributors(
			Set<LookAndFeelDescriptorContributor> contributors) {
		this.contributors = contributors;
	}

	@PostConstruct
	public void afterPropertiesSet() throws Exception {
		for (LookAndFeelDescriptorContributor contributor : contributors) {
			contributor.contribute(lookAndFeelRegistry);
		}
	}

}
